﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
namespace UIControls
{
    public class PreviewComboBox:ComboBox
    {
        public delegate void PreviewSelectionChangedDelegate(object sender, SelectionChangedEventArgs e);

        public event PreviewSelectionChangedDelegate PreviewSelectionChanged;

        protected override void OnSelectionChanged(SelectionChangedEventArgs e)
        {
            if (PreviewSelectionChanged != null)
            {
                PreviewSelectionChanged(this, e);
            }

            if (!e.Handled)
            {
                base.OnSelectionChanged(e);
            }
        }

    }
}
